<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <!-- 插值绑定 -->
    <p>{{name}}</p>
    <!-- 指令解析 -->
    <p l-text="name"></p>
    <p>{{age}}</p>
    <p>{{doubleAge}}</p>
    <!-- 双向绑定 -->
    <input type="text" l-model="name">
    <!-- 事件处理 -->
    <button @click="changeName">呵呵</button>
    <!-- html内容解析 -->
    <div l-html="html"></div>
  </div>
  <script src="./js/MyVue.js"></script>
  <script src="./js/Dep.js"></script>
  <script src="./js/Watcher.js"></script>
  <script src="./js/Compile.js"></script>

  <script>
    // const inp = document.getElementsByTagName('input')[0];
    // console.log(Array.from(inp.attributes));
    const lxq = new MyVue({
      el: '#app',
      data: {
        name: 'i am test',
        age: 18,
        html: `<button>这是一个按钮</button>`
      },
      created() {
        console.log('start')
        setTimeout(() => {
          this.name = `this is a test`
        }, 1500)
      },
      methods: {
        changeName() {
          this.name = '夜殇'
          this.age = 21
        }
      }
    })
  </script>
</body>
</html>